package com.parsec.sb.filter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@Slf4j
@WebFilter(filterName = "TestOrderOneFilter", urlPatterns = "/*")
@Order(1)
@Component
public class TestOrderOneFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        log.info("进入过滤器1，TestOrderOneFilter");
        filterChain.doFilter(servletRequest, servletResponse);
        log.info("离开过滤器1，TestOrderOneFilter");
    }
}
